@extends('layouts.adminLayouts')

@section('mainContent')

    <form action="" method="post">
        <div class="box" style="margin-top: 15px;">
            <div class="box-header">
                <h3 class="box-title">用户列表</h3>
            </div>

            <div class="box-body">
                @foreach($roles as $row)
                    <label class="radio-inline">
                        <input type="radio" name="data[roles_id]" value="{{$row->id}}">{{$row->name}}
                    </label>
                @endforeach
            </div>

        </div>

        <div class="box" id="meus">
            <div class="box-body">
                {!! $muen !!}
            </div>
        </div>

        <div class="box">
            <div class="box-footer">
                <div class="btn-group">
                    {{csrf_field()}}
                    <button class="btn btn-default">保存</button>
                    <button class="btn btn-danger">取消</button>
                </div>
            </div>
        </div>
    </form>

@endsection

@section('javascript')
    <script>
        $('#meus').hide();

        var checkBox = $('input[type="radio"]');

        checkBox.on('ifChecked ifUnchecked', function (event) {
            var val = $('input[type="radio"]:checked').val();
            if (val == 2) {
                $('#meus').show();
            } else {
                $('#meus').hide();
            }
        });

    </script>
@endsection



